import store from "../store";
export default class PlaneInfo{
	constructor(){
		this.planeInfo = {}
	}
	static updatePlaneInfo(data){
		console.log(111);
		if(!data){
			return;
		}
		if(!this.planeInfo){
			this.planeInfo = {}
		}
		this.planeInfo = {
			...this.planeInfo,
			...data
		}
		console.log("planeInfo==",this.planeInfo);
		uni.setStorageSync('planeInfo',this.planeInfo)
		store.dispatch("user/updatePlaneInfo",this.planeInfo)
	}
	static initPlaneInfo(){
		if(uni.getStorageSync('planeInfo')){
			this.planeInfo = uni.getStorageSync('planeInfo');
		}else{
			this.planeInfo = {}
		}
		store.dispatch("user/updatePlaneInfo",this.planeInfo)
	}
	static clearPlaneInfo(){
		console.log(111);
		this.planeInfo = {}
		uni.removeStorageSync('planeInfo');
		store.dispatch("user/updatePlaneInfo",this.planeInfo)
	}
}